#include <iostream>
#include <ctime>

#define DEG_LEVER 0
#define INF_LEVER 1
#define ERR_LEVER 2
#define DEFAULT_LEVER DEG_LEVER

#define LOG(lever_str,lever,format,...) {\
    if(lever >= DEFAULT_LEVER){\
        time_t t=time(nullptr);\
        struct tm* ptm=localtime(&t);\
        char time_str[32];\
        strftime(time_str,31,"%H:%M:%S",ptm);\
        printf("[%s][%s][%s,%d]\t" format "\n",lever_str,time_str,__FILE__,__LINE__,##__VA_ARGS__);\
    }\
}

#define DLOG(format,...) LOG("DBG",DEG_LEVER,format,DEG_LEVER)
#define ILOG(format,...) LOG("INF",INF_LEVER,format,DEG_LEVER)
#define ELOG(format,...) LOG("ERR",ERR_LEVER,format,DEG_LEVER)

int main()
{
    DLOG("hello world");
    ILOG("hello world");
    return 0;
}